<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"      
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:component="http://java.sun.com/jsf/composite/component">

    <ui:composition template="/resources/include/template.xhtml">

        <ui:define name="title">

            <h:outputText value="#{bundle.Bambole} - #{bundle.Session}"></h:outputText>

        </ui:define>

        <ui:define name="body">

            <h:form>

                <ui:include src="/resources/include/menu.xhtml"/>       

                <p:panel header="#{bundle.Bambole} - #{bundle.Session}">            

                    <h:panelGrid columns="3"
                                 columnClasses="columnWidth48, columnWidth4, columnWidth48"
                                 width="90%"
                                 style="margin-left: auto; margin-right: auto">

                        <h:panelGrid columns="1"
                                     columnClasses="columnWidth100"
                                     rowClasses="rowAlign"
                                     width="100%">

                            <p:outputLabel value="#{bundle.Locale}"
                                           for="selectLocale"/>

                            <p:selectOneMenu id="selectLocale"
                                             style="width: 100%"
                                             value="#{localizationUtil.selected}"
                                             converter="localeConverter"
                                             tabindex="00"
                                             required="true">

                                <f:selectItems value="#{localizationUtil.itemsAvailableSelectOne}"/>

                                <p:ajax listener="#{localizationUtil.updateSelection}"
                                        update="@form"/>    

                            </p:selectOneMenu>                                        

                        </h:panelGrid>              

                        <p:spacer/>

                        <h:panelGrid columns="1"
                                     columnClasses="columnWidth100"
                                     rowClasses="rowAlign"
                                     width="100%">

                            <p:outputLabel value="#{bundle.Theme}"
                                           for="selectTheme"/>              

                            <p:themeSwitcher id="selectTheme"
                                             value="#{themeUtil.selected}"
                                             tabindex="01"
                                             style="width: 100%"
                                             required="true">

                                <f:selectItems value="#{themeUtil.itemsAvailableSelectOne}"/>

                                <p:ajax listener="#{themeUtil.updateSelection}"
                                        update="@all"/>

                                <p:ajax update="selectTheme"/>

                                <p:ajax update="selectLocale"/>

                            </p:themeSwitcher>              

                        </h:panelGrid>

                    </h:panelGrid>                                 

                </p:panel>

            </h:form>

        </ui:define>

    </ui:composition>

</html>